using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace HamcoWcs.Entitys.DeviceMsgQueues
{
    public class DeviceMsgQueueConfig : IEntityTypeConfiguration<DeviceMsgQueue>
    {
        public void Configure(EntityTypeBuilder<DeviceMsgQueue> builder)
        {
            builder.HasComment("托盘输/堆垛机送线消息队列");
            builder.Property(x => x.PlcName).IsRequired().HasMaxLength(30).HasComment("PLC名");
            builder.Property(x => x.DeviceName).IsRequired().HasMaxLength(30).HasComment("设备名");
            builder.Property(x => x.StartPoint).IsRequired().HasComment("DB偏移量");
            builder.Property(x => x.MsgValue).IsRequired().HasMaxLength(255).HasComment("消息内容，bytes转换为string");
            builder.Property(x => x.MessageName).HasMaxLength(50).HasComment("消息名称");
            builder.Property(x => x.TaskId).HasMaxLength(50).HasComment("任务号");
        }
    }
}